package com.bzkj.web.controller.ncc;

import com.bzkj.basicinfo.domain.ncc.NccBasicMaterialstock;
import com.bzkj.basicinfo.domain.ncc.dto.NccBasicMaterialstockDto;
import com.bzkj.basicinfo.service.ncc.NccBasicMaterialstockService;
import com.bzkj.common.core.controller.BaseController;
import com.bzkj.common.core.domain.AjaxResult;
import com.bzkj.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * @Author wangzhichao
 * @ClassName NccBasicMaterialstockController
 * @Date 2024/12/11 14:56:31
 * @description ncc物料库存信息
 */
@RestController
@RequestMapping("ncc/basic/materialstock")
public class NccBasicMaterialstockController extends BaseController
{
    @Autowired
    private NccBasicMaterialstockService nccBasicMaterialstockService;

    /**
     * 条件查询物料库存信息
     * @Author wangzhichao
     * @Date 2024/12/11 15:08:54
     * @Param dto
     */
    @PreAuthorize("@ss.hasPermi('basic:nccBasic:query')")
    @GetMapping("findNccBasicMaterialstockData")
    public TableDataInfo findNccBasicMaterialstockData(NccBasicMaterialstockDto dto){
        startPage();
        return getDataTable(nccBasicMaterialstockService.findNccBasicMaterialstockData(dto));
    }

    /**
     * 根据pkmaterialstock修改ncc物料库存信息
     * @Author wangzhichao
     * @Date 2024/12/11 15:19:36
     * @Param entity
     */
    @PreAuthorize("@ss.hasPermi('basic:nccBasic:edit')")
    @PutMapping("nccBasicMaterialstockUpdate")
    public AjaxResult nccBasicMaterialstockUpdate(@RequestBody NccBasicMaterialstock entity){
        return nccBasicMaterialstockService.nccBasicMaterialstockUpdate(entity);
    }

    /**
     * 新增ncc物料库存信息
     * @Author wangzhichao
     * @Date 2024/12/11 15:32:14
     * @Param entity
     */
    @PreAuthorize("@ss.hasPermi('basic:nccBasic:add')")
    @PostMapping("nccBaiscMaterialstockSave")
    public AjaxResult nccBaiscMaterialstockSave(@RequestBody NccBasicMaterialstock entity){
        return nccBasicMaterialstockService.nccBaiscMaterialstockSave(entity);
    }



}
